const { createProxyMiddleware } = require('http-proxy-middleware');

module.exports = function (app) {
  app.use(
    createProxyMiddleware('/app', {
      target: 'http://localhost:8180',
      changeOrigin: true,
    }),
    createProxyMiddleware('/gateway', {
      target: 'http://localhost:8180',
      changeOrigin: true,
    }),
    createProxyMiddleware('/datapoint', {
      target: 'http://localhost:8180',
      changeOrigin: true,
    }),
    createProxyMiddleware('/mqtt', {
      target: 'http://localhost:8180',
      changeOrigin: true,
    }),
    createProxyMiddleware('/log', {
      target: 'http://localhost:8180',
      changeOrigin: true,
    }),
    createProxyMiddleware('/alarm', {
      target: 'http://localhost:8180',
      changeOrigin: true,
    }),
    createProxyMiddleware('/gatelog', {
      target: 'http://localhost:8180',
      changeOrigin: true,
    }),

    createProxyMiddleware('/identify', {
      target: 'http://localhost:8180',
      changeOrigin: true,
    }),
    createProxyMiddleware('/goods', {
      target: 'http://localhost:8180',
      changeOrigin: true,
    }),
    createProxyMiddleware('/sale', {
      target: 'http://localhost:8180',
      changeOrigin: true,
    }),
    createProxyMiddleware('/logistics', {
      target: 'http://localhost:8180',
      changeOrigin: true,
    }),
  );

};